package org.zjt.java.demo.services.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zjt.java.demo.repository.UserRepository;
import org.zjt.java.demo.entity.User;
import org.zjt.java.demo.entity.UserQuery;


import javax.annotation.PostConstruct;
import java.util.List;

/**
 * Created by hjf on 2016/5/16.
 */
@Service
public class TestServices {

    @Autowired
    private UserRepository userRepository;


    public String show() {
        return "hello world 张军涛!";
    }


    public List<User> showDao(int age) {
        UserQuery userQuery = new UserQuery();
        userQuery.createCriteria().andUserNameIsNotNull();
        return userRepository.selectByExample(userQuery);
    }


    @PostConstruct
    public void main() {
        System.out.println(showDao(22));
    }
}
